Home:ALL Converter>How to change the color of a diagram cell while hovering?

How to change the color of a diagram cell while hovering?

Ask Time:2020-02-24T00:54:30         Author:Lenka

Json Formatter

I have an uml diagram and I want to change the color of one cell when the cursor is on it.

I tried to do it programmatically, but it doesn't work.

Here's my code:

paper.on('cell:mouseover', function(cellView, evt, x, y) { 
    var cell = graph.getCell(cellView.model.id)

    if (cell.isElement()) {
         cellView.model.attr({'uml-class-name-rect': { fill: '#33C3FF' }});
    } 
}

Author:Lenka,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60364578/how-to-change-the-color-of-a-diagram-cell-while-hovering
yy